package com.paireach.bw.activity;

import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.transition.Transition;
import android.transition.TransitionInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import com.paireach.bw.R;
import com.paireach.bw.base.BaseActivity;
import com.tencent.bugly.beta.Beta;


/**
 * Title: VersionInfoActivity
 * Description: 个人中心的版本信息
 * company: 上海双至
 */
public class VersionInfoActivity extends BaseActivity {

    private TextView layout_top_change;
    private ImageView layout_top_back;
    private TextView tv_versio;
    private Button btn_update;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (Build.VERSION.SDK_INT >= 21) {
            getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
            Transition slide_bottom = TransitionInflater.from(this).inflateTransition(android.R.transition.slide_bottom);
            getWindow().setEnterTransition(slide_bottom);
        }

        setContentView(R.layout.activity_version_info);
        initView();
    }

    private void initView() {
        tv_versio = (TextView) findViewById(R.id.tv_version);
        layout_top_change = (TextView) findViewById(R.id.layout_top_change);
        layout_top_back = (ImageView) findViewById(R.id.layout_top_back);
        btn_update = (Button) findViewById(R.id.btn_update);

        layout_top_change.setText("版本信息");
        layout_top_back.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                onBackPressed();
            }
        });
        btn_update.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View view) {
                Beta.checkUpgrade();
            }
        });
    }
}
